import { createRouter, createWebHistory } from "vue-router";
import LayoutIndex from "@/views/layout/LayoutIndex.vue";
import {HomeFilled, List, Management, Shop, Ticket} from "@element-plus/icons-vue";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      name: "Home",
      redirect: "/home",
      component: LayoutIndex,
      meta: { title: "首页",icon: HomeFilled },
      children: [
        {
          path: "/home",
          name: "Dashboard",
          meta: { title: "仪表盘", icon: "DashboardOutlined", key: '1', subMenu: "sub1" },
          component: () => import("@/views/dashboard/Home.vue"),
        },
        {
          path: "/about",
          name: "About",
          meta: { title: "学习教程", icon: "Notebook", key: '2', subMenu: "sub1" },
          component: () => import("@/views/dashboard/about.vue"),
        },
        {
          path: "/video",
          name: "Video",
          meta: { title: "视频教程", icon: "VideoCamera", key: '3', subMenu: "sub1" },
          component: () => import("@/views/dashboard/video.vue"),
        },
      ],
    },
    {
      path: "/product/list",
      name: "Product",
      component: LayoutIndex,
      meta: { title: "商品",icon: Shop },
      children: [
        {
          path: "/product/list",
          name: "List",
          meta: { title: "商品列表", icon: "UnorderedListOutlined", key: '4', subMenu: "sub2" },
          component: () => import("@/views/product/productList/productList.vue"),
        },
        {
          path: "/product/add",
          name: "AddProduct",
          meta: { title: "添加商品", icon: "FileAddOutlined", key: '5', subMenu: "sub2" },
          component: () => import("@/views/product/productList/productAdd.vue"),
        },
        {
          path: "/product/category",
          name: "ProductCategory",
          meta: { title: "商品分类", icon: "ClusterOutlined", key: '6', subMenu: "sub2" },
          component: () => import("@/views/product/productCate/productCate.vue"),
        },
        {
          path: "/product/attribute",
          name: "ProductAttribute",
          meta: { title: "商品类型", icon: "BranchesOutlined", key: '7', subMenu: "sub2" },
          component: () => import("@/views/product/productAttr/productAttr.vue"),
        },
        {
          path: "/product/brand",
          name: "ProductBrand",
          meta: { title: "品牌管理", icon: "TagsOutlined", key: '8', subMenu: "sub2" },
          component: () => import("@/views/product/brand/productBrand.vue"),
        },
        {
          path: "/product/brand/updateBrand",
          name: "UpdateBrand",
          hidden:true,
          meta: { title: "编辑添加品牌", icon: "TagsOutlined" },
          component: () => import("@/views/product/brand/components/brandDetail.vue"),
        }
      ],
    },
    {
      path: "/detail/list",
      name: "Order",
      component: LayoutIndex,
      meta: { title: "订单",icon: List },
      children: [
        {
          path: "/detail/list",
          name: "OrderList",
          meta: { title: "订单列表", icon: "OrderedListOutlined", key: '9', subMenu: "sub3" },
          component: () => import("@/views/order/detail/orderList.vue"),
        },
        {
          path: "/detail/order",
          name: "OrderDetail",
          meta: { title: "订单详情", icon: "OrderedListOutlined", key: '9', subMenu: "sub3" },
          hidden:true,
          component: () => import("@/views/order/detail/components/orderDetail.vue"),
        },
        {
          path: "/deliverList/order",
          name: "DeliverList",
          meta: { title: "发货列表", icon: "OrderedListOutlined", key: '9', subMenu: "sub3" },
          hidden:true,
          component: () => import("@/views/order/detail/components/deliverList.vue"),
        },
        {
          path: "/detail/setting",
          name: "OrderSetting",
          meta: { title: "订单设置", icon: "SettingOutlined", key: '10', subMenu: "sub3" },
          component: () => import("@/views/order/orderSetting.vue"),
        },
        {
          path: "/detail/return",
          name: "ReturnApplication",
          meta: { title: "退货申请处理", icon: "CarryOutOutlined", key: '11', subMenu: "sub3" },
          component: () => import("@/views/order/apply/returnApplication.vue"),
        },
        {
          path: "/detail/reason",
          name: "ReturnReason",
          meta: { title: "退货原因设置", icon: "FormOutlined", key: '12', subMenu: "sub3" },
          component: () => import("@/views/order/apply/returnReason.vue"),
        },
        {
          path: "/detail/return/applyDetail",
          name: "ReturnDetail",
          meta: { title: "退货详情", icon: "FileTextOutlined", key: '12', subMenu: "sub3" },
          hidden:true,
          component: () => import("@/views/order/apply/components/applyDetail.vue"),
        }
      ],
    },
    {
      path: "/marketing/flash",
      name: "Marketing",
      component: LayoutIndex,
      meta: { title: "营销",icon: Ticket },
      children: [
        {
          path: "/marketing/flash",
          name: "Flash",
          meta: { title: "秒杀活动", icon: "AlarmClock", key: '13', subMenu: "sub4" },
          component: () => import("@/views/marketing/spikesActivity/spikesList.vue"),
        },
        {
          path: "/flash/flashList",
          name: "FlashList",
          meta: { title: "秒杀时间列表", icon: "AlarmClock", key: '13', subMenu: "sub4" },
          hidden:true,
          component: () => import("@/views/marketing/spikesActivity/components/flashList.vue"),
        },
        {
          path: "/flash/selectTime",
          name: "SelectTime",
          meta: { title: "秒杀设置时间段", icon: "AlarmClock", key: '13', subMenu: "sub4" },
          hidden:true,
          component: () => import("@/views/marketing/spikesActivity/components/selectTime.vue"),
        },
        {
          path: "/flash/productRelationList",
          name: "ProductRelationList",
          meta: { title: "关联商品", icon: "AlarmClock", key: '13', subMenu: "sub4" },
          hidden:true,
          component: () => import("@/views/marketing/spikesActivity/components/productRelationList.vue"),
        },
        {
          path: "/marketing/coupon",
          name: "CouponManagement",
          meta: { title: "优惠券管理", icon: "PayCircleOutlined", key: '14', subMenu: "sub4" },
          component: () => import("@/views/marketing/couponManage/couponManagement.vue"),
        },
        {
          path: "/detail/coupon/checkList",
          name: "CouponCheckList",
          meta: { title: "优惠券领取详情",icon: "PayCircleOutlined", key: '14', subMenu: "sub4"},
          hidden:true,
          component: () => import("@/views/marketing/couponManage/components/checkList.vue"),
        },
        {
          path: "/detail/coupon/editList",
          name: "CouponEditList",
          meta: { title: "优惠券修改",icon: "PayCircleOutlined", key: '14', subMenu: "sub4"},
          hidden:true,
          component: () => import("@/views/marketing/couponManage/components/couponDetail.vue"),
        },
        {
          path: "/marketing/brandRecommend",
          name: "BrandRecommend",
          meta: { title: "品牌推荐", icon: "TagOutlined", key: '15', subMenu: "sub4" },
          component: () => import("@/views/marketing/brandRec/brandRecommend.vue"),
        },
        {
          path: "/marketing/newRecommend",
          name: "NewRecommend",
          meta: { title: "新品推荐", icon: "ShoppingOutlined", key: '16', subMenu: "sub4" },
          component: () => import("@/views/marketing/newRecommend/newRecommend.vue"),
        },
        {
          path: "/marketing/hotRecommend",
          name: "HotRecommend",
          meta: { title: "人气推荐", icon: "FireOutlined", key: '17', subMenu: "sub4" },
          component: () => import("@/views/marketing/hotRecommend/hotRecommend.vue"),
        },
        {
          path: "/marketing/topicRecommend",
          name: "TopicRecommend",
          meta: { title: "专题推荐", icon: "ReconciliationOutlined", key: '18', subMenu: "sub4" },
          component: () => import("@/views/marketing/topicRecommend/topicRecommend.vue"),
        },
        {
          path: "/marketing/adList",
          name: "AdList",
          meta: { title: "广告列表", icon: "SoundOutlined", key: '19', subMenu: "sub4" },
          component: () => import("@/views/marketing/advertise/advertiseList.vue"),
        },
        {
          path: "/marketing/updateAdvertise",
          name: "UpdateAdvertise",
          meta: { title: "编辑广告", icon: "EditOutlined"},
          hidden:true,
          component: () => import("@/views/marketing/advertise/components/updateAdvertise.vue"),
        }
      ],
    },
    {
      path: "/permission/userList",
      name: "Permission",
      component: LayoutIndex,
      meta: { title: "权限",icon: Management },
      children: [
        {
          path: "/permission/userList",
          name: "UserList",
          meta: { title: "用户列表", icon: "UserOutlined", key: '20', subMenu: "sub5" },
          component: () => import("@/views/permission/user/userList.vue"),
        },
        {
          path: "/permission/allocMenu",
          name: "AllocMenu",
          hidden: true,
          meta: { title: "分配菜单"},
          component: () => import("@/views/permission/roles/component/allocMenu.vue"),
        },
        {
          path: "/permission/allocResource",
          name: "AllocResource",
          hidden: true,
          meta: { title: "分配资源"},
          component: () => import("@/views/permission/roles/component/allocResource.vue"),
        },
        {
          path: "/permission/roleList",
          name: "RoleList",
          meta: { title: "角色列表", icon: "TeamOutlined", key: '21', subMenu: "sub5" },
          component: () => import("@/views/permission/roles/roleList.vue"),
        },
        {
          path: "/permission/menuList",
          name: "MenuList",
          meta: { title: "菜单列表", icon: "AppstoreOutlined", key: '22', subMenu: "sub5" },
          component: () => import("@/views/permission/menu/menuList.vue"),
        },
        {
          path: "/permission/menuList/updateMenu",
          name: "UpdateMenu",
          hidden: true,
          meta: { title: "更新菜单" },
          component: () => import("@/views/permission/menu/components/menuDetail.vue"),
        },

        {
          path: "/permission/resourceList",
          name: "ResourceList",
          meta: { title: "资源列表", icon: "DeploymentUnitOutlined", key: '23', subMenu: "sub5" },
          component: () => import("@/views/permission/resource/resourceList.vue"),
        },
        {
          path: "/permission/resourceCategory",
          name: "ResourceCategory",
          meta: { title: "资源分类" },
          hidden:true,
          component: () => import("@/views/permission/resource/components/resourceCategory.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "Login",
      component: () => import("@/views/login/LoginIndex.vue"),
    },

  ],
});

export default router;
